package DTO;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.File;

/**
 * @description: 用于描述所选表格配置是否正确的数据传输对象
 * @author: ziger
 * @time: 2022/8/28 11:42
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
public class ExcelConfigDTO {

    private File excelFile;
    private int beginRow;
    private int beginColum;
    private int endRow;
    private int endColum;
    private int currentRow;
    private int currentColum;


    /**
     * 判断该配置是否合法
     * @return
     */
    public boolean isRight(){
        if (beginRow <= endRow && beginColum <= endColum && currentRow >= beginRow
        && currentRow <= endRow && currentColum >= beginColum && currentColum <= endColum){
            return true;
        }else {
            return false;
        }
    }

}
